const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  transpileDependencies: true,
  devServer:{
    proxy:{
      //前缀
      '/atguigu':{
        target:'https://alapi.cn/',
        pathRewrite:{'^/atguigu':''},
        //ws和changeOrigin 不写默认都是true
        secure:false,
          ws:true, //用于支持websocket
         changeOrigin:true //用于控制请求头中的host值m
      },
      '/demo':{
        target:'http://localhost:5001',
        pathRewrite:{'^/demo':''},
      }
    }
  }
})
